package com.kenny.provider.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Kenny Kam
 * @date 2021/1/8 16:20
 */
@RefreshScope
@RestController
@RequestMapping("/demo")
public class DemoController {
    @Value("${data.code}")
    String code;
    @Value("${dev.code}")
    String devCode;

    @PostMapping("/refresh")
    public void refresh() {
        System.out.printf("data: %s\n", code);
        System.out.printf("dev : %s\n", devCode);
        System.out.println("======================");
    }
}
